﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using UMS.Essences;

namespace UMS
{
    public partial class UserChooseForm : Form
    {
        public User User { get { return Us; } }
        User Us; 

        public UserChooseForm()
        {
            InitializeComponent();
        }

        private void UserChooseForm_Load(object sender, EventArgs e)
        {
            tbServer.Text = Properties.Settings.Default.ServerAddress;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.ServerAddress = tbServer.Text;
            User u = new User(new UIN(tbUIN.Text));
            u.Password = tbPass.Text;
            DialogResult = System.Windows.Forms.DialogResult.OK;
            this.Close();
        }

        private void button3_Click(object sender, EventArgs e)
        {
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.Close();
        }
    }
}
